package com.micangcaihang.micang.mvp.task.ui;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.micangcaihang.common.base.fragment.BaseFragment;
import com.micangcaihang.common.utils.ConvertUtils;
import com.micangcaihang.common.utils.StringUtils;
import com.micangcaihang.common.utils.TimeUtils;
import com.micangcaihang.micang.R;
import com.micangcaihang.micang.adapter.AccessoryInfoAdapter;
import com.micangcaihang.micang.databinding.FragmentCommentaryExamineBinding;
import com.micangcaihang.micang.entity.CommentaryExamineEntity;
import com.micangcaihang.micang.mvp.task.contract.ExamineCommentaryContract;
import com.micangcaihang.micang.mvp.task.presenter.ExamineCommentaryPresenter;

import net.cachapa.expandablelayout.ExpandableLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * <pre>
 *     author : Fandy
 *     e-mail : fandayongfly@gmail.com
 *     time   : 2017/8/14
 *     update : 2017/8/14
 *     desc   : 调评资料审查
 *     version: 1.0
 * </pre>
 */
public class ExmaineCommentaryFragment extends BaseFragment<ExamineCommentaryPresenter,
        FragmentCommentaryExamineBinding> implements ExamineCommentaryContract.View, AccessoryInfoAdapter.OnItemClickListener {

    private AccessoryInfoAdapter mAdapter;
    private String id;
    private View mHeaderView;
    private ViewHolder mViewHolder;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        id = getArguments().getString("id");
    }

    public static ExmaineCommentaryFragment newInstance(String id) {
        Bundle args = new Bundle();
        ExmaineCommentaryFragment fragment = new ExmaineCommentaryFragment();
        args.putString("id", id);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void initView(View rootView) {
        super.initView(rootView);
        mHeaderView = LayoutInflater.from(_mActivity).inflate(R.layout.header_examine_commentary, (ViewGroup) mViewBinding.recyclerView.getParent(), false);
        mViewHolder = new ViewHolder(mHeaderView);
        mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
    }

    @Override
    public void initPresenter() {
        super.initPresenter();
        mPresenter.setId(id);
    }

    @Override
    protected void initData() {
        super.initData();
        mAdapter = new AccessoryInfoAdapter(_mActivity, new ArrayList<>(), false);
        mAdapter.addHeaderView(mHeaderView, 0);
        mViewBinding.recyclerView.setAdapter(mAdapter);
    }

    /**
     * 获取资源文件布局
     *
     * @return 资源布局文件layout
     */
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_commentary_examine;
    }

    /**
     * 初始化按钮监听
     */
    @Override
    protected void initListener() {
        mAdapter.setOnItemClickListener(this);
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, int parentPos, int position, View v) {
        MiPictureExternalPreviewActivity.externalPicturePreview(_mActivity, position,
                mAdapter.getData().get(parentPos).getFile_content(),
                StringUtils.isEmpty(mAdapter.getData().get(parentPos).getFile_name()) ? mAdapter.getData().get(parentPos).getFile_type_name() : mAdapter.getData().get(parentPos).getFile_name()
                , 1);
    }


    private void setExpandDrawable(TextView view, boolean isExpand) {
        Drawable drawable;
        if (isExpand) {
            drawable = _mActivity.getResources().getDrawable(R.drawable.ic_collapse);
        } else {
            drawable = _mActivity.getResources().getDrawable(R.drawable.ic_expand);
        }
        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());//必须设置图片大小，否则不显示
        view.setCompoundDrawables(null, null, drawable, null);
    }

    @Override
    public void returnCommentaryExamine(CommentaryExamineEntity entity) {
        mProgressLinearLayout.showContent();
        mAdapter.setNewData(entity.getFiles());
        //抵押物编号
        mViewHolder.tvPawnNo.setText(String.format(_mActivity.getString(R.string.delivery_d_pledge_number_colon), entity.getPawn_no()));
        //产权人
        mViewHolder.tvPropertyOwner.setText(entity.getProperty_owner());
        //房屋坐落
        mViewHolder.tvHouseLocated.setText(entity.getHouse_located());
        //小区名称
        mViewHolder.tvCommunityName.setText(entity.getCommunity_name());
        //房产证编号
        mViewHolder.tvCertificateNumber.setText(entity.getCertificate_number());
        //建筑面积
        mViewHolder.tvStructureArea.setText(entity.getStructure_area());
        //建筑面积
        mViewHolder.tvBuildYear.setText(entity.getBuild_year());
        //现在楼牌号
        mViewHolder.tvDoorNumber.setText(entity.getDoor_number());
        //环路区间
        mViewHolder.tvRingRdDirection.setText(entity.getRing_rd_direction() + entity.getCircle_position());
        //房屋结构
        mViewHolder.tvRoomConstruction.setText(entity.getRoom_construction());
        //产权类型
        mViewHolder.tvPropertyRightType.setText(entity.getProperty_right_type());
        //房屋用途
        mViewHolder.tvHouseUse.setText(entity.getHouse_use());
        //登记时间
        try {
            String s = TimeUtils.millis2StringDay(Long.parseLong(entity.getCheckin_date()) * 1000);
            mViewHolder.tvCheckinDate.setText(s);
        } catch (Exception e) {
            mViewHolder.tvCheckinDate.setText("");
        }
        //房屋朝向
        mViewHolder.tvHourseOrientation.setText(entity.getHourse_orientation());
        //房屋户型
        StringBuffer amount = new StringBuffer();
        if (!StringUtils.isEmpty(entity.getRoom_amount())) {
            amount.append(entity.getRoom_amount()).append("室");
        }
        if (!StringUtils.isEmpty(entity.getHall_amount())) {
            amount.append(entity.getHall_amount()).append("厅");
        }
        if (!StringUtils.isEmpty(entity.getKitchen_amount())) {
            amount.append(entity.getKitchen_amount()).append("厨");
        }
        if (!StringUtils.isEmpty(entity.getToilet_amount())) {
            amount.append(entity.getToilet_amount()).append("卫");
        }
        mViewHolder.tvRoomAmount.setText(amount.toString());
        //所在楼
        mViewHolder.tvFloorNumber.setText(entity.getFloor_number());
        //楼层总数
        mViewHolder.tvAllFloor.setText(entity.getAll_floor());
        //装修状况
        mViewHolder.tvFitmentStatus.setText(entity.getFitment_status());
        //建筑类型
        mViewHolder.tvStructureType.setText(entity.getStructure_type());
        //使用状态
        mViewHolder.tvUseinStatue.setText(entity.getUsein_statue());
        //整体结构
        mViewHolder.tvStructureModify.setText(entity.getStructure_modify());
        //唯一房产
        mViewHolder.tvIsOnlyHouse.setText(entity.getIs_only_house());
        //其他房产
        mViewHolder.tvOtherHouseAmount.setText(entity.getOther_house_amount());
        //购买年数
        mViewHolder.tvPurchaseYear.setText(entity.getPurchase_year());
        //供水
        mViewHolder.tvSupportWater.setText(entity.getSupport_water());
        //燃气
        mViewHolder.tvSupportGas.setText(entity.getSupport_gas());
        //供暖
        mViewHolder.tvSupportHeat.setText(entity.getSupport_heat());
        //电梯
        mViewHolder.tvSupportLift.setText(entity.getSupport_lift());
        //车位
        mViewHolder.tvSupportCarport.setText(entity.getSupport_carport());
        //其他车位
        mViewHolder.tvSupportOtherCarport.setText(entity.getSupport_other_carport());
        //物业服务
        mViewHolder.tvHasServiceCharge.setText(entity.getHas_service_charge());
        //物业名称
        mViewHolder.tvServiceName.setText(entity.getService_name());
        //物业价格
        mViewHolder.tvServiceMoneyStandard.setText(entity.getService_money_standard());
        //道路名称
        mViewHolder.tvRoadName.setText(entity.getRoad_name());
        //直线距离
        mViewHolder.tvRoadDistance.setText(entity.getRoad_distance());
        //道路等级
        mViewHolder.tvRoadLevel.setText(entity.getRoad_level());
        //地铁线路
        mViewHolder.tvTransit.setText(entity.getTransit());
        //步行至地铁时间
        mViewHolder.tvTransitDistance.setText(entity.getTransit_distance());
        //公交线路
        mViewHolder.tvMetro.setText(entity.getMetro());
        //步行至公交线路
        mViewHolder.tvMetroDistance.setText(entity.getMetro_distance());
        CommentaryExamineEntity.SupportBean support = entity.getSupport();
        List<CommentaryExamineEntity.SupportBean.Support0Bean> support0 = support.getSupport0();
        List<CommentaryExamineEntity.SupportBean.Support1Bean> support1 = support.getSupport1();
        List<CommentaryExamineEntity.SupportBean.Support2Bean> support2 = support.getSupport2();
        //商业配套
        StringBuffer supportBuffer0 = new StringBuffer();
        for (CommentaryExamineEntity.SupportBean.Support0Bean bean : support0) {
            supportBuffer0.append(bean.getSupport_id()).append(",");
        }
        if (supportBuffer0.length() > 0) {
            mViewHolder.tvSupport0.setText(supportBuffer0.toString().substring(0, supportBuffer0.toString().length() - 1));
        }
        //生活配套
        StringBuffer supportBuffer1 = new StringBuffer();
        for (CommentaryExamineEntity.SupportBean.Support1Bean bean : support1) {
            supportBuffer1.append(bean.getSupport_id()).append(",");
        }
        if (supportBuffer1.length() > 0) {
            mViewHolder.tvSupport1.setText(supportBuffer1.toString().substring(0, supportBuffer1.toString().length() - 1));
        }
        //其他配套
        StringBuffer supportBuffer2 = new StringBuffer();
        for (CommentaryExamineEntity.SupportBean.Support2Bean bean : support2) {
            supportBuffer2.append(bean.getSupport_id()).append(",");
        }
        if (supportBuffer2.length() > 0) {
            mViewHolder.tvSupport2.setText(supportBuffer2.toString().substring(0, supportBuffer2.toString().length() - 1));
        }
        //土地坐落
        mViewHolder.tvLandPosition.setText(entity.getLand_position());
        //土地(用途)
        mViewHolder.tvLandUse.setText(entity.getLand_use());
        //土地证编号
        mViewHolder.tvLandlCertificateNumber.setText(entity.getLandl_certificate_number());
        //终止日期
        try {
            String s = TimeUtils.millis2StringDay(Long.parseLong(entity.getLand_end_date()) * 1000);
            mViewHolder.tvLandEndDate.setText(s);
        } catch (Exception e) {
            mViewHolder.tvLandEndDate.setText("");
        }
        //使用权面积
        mViewHolder.tvLandUseType.setText(entity.getLand_use_type());
        //使用权类型
        mViewHolder.tvLandArea.setText(entity.getLand_area());
        //抵押物总体概述及备注
        mViewHolder.tvCollateralRemark.setText(entity.getCollateral_remark());
        //抵押物调查评估意见
        mViewHolder.tvCollateralOpinion.setText(entity.getCollateral_opinion());
        //特殊备注
        mViewHolder.tvSpecialNote.setText(entity.getSpecial_note());
        CommentaryExamineEntity.EvaluateBean evaluate = entity.getEvaluate();
        List<CommentaryExamineEntity.EvaluateBean.Evaluate2Bean> evaluate2 = evaluate.getEvaluate2();
        List<CommentaryExamineEntity.EvaluateBean.Evaluate3Bean> evaluate3 = evaluate.getEvaluate3();
        int i = 1;
        LinearLayout layout = new LinearLayout(_mActivity);
        layout.setOrientation(LinearLayout.VERTICAL);
        layout.setBackgroundResource(R.color.white_bg);
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        layout.setLayoutParams(lp);
        layout.setPadding(ConvertUtils.dp2px(10), 0, 0, 0);
        for (CommentaryExamineEntity.EvaluateBean.Evaluate2Bean bean : evaluate2) {
            View view = LayoutInflater.from(_mActivity).inflate(R.layout.item_examine_price_new, null);
            TextView tvTitle = (TextView) view.findViewById(R.id.tv_new_title);
            TextView tvUnitPrice = (TextView) view.findViewById(R.id.tv_unit_price);
            TextView tvReferenceName = (TextView) view.findViewById(R.id.tv_reference_name);
            TextView tvEstimateFee = (TextView) view.findViewById(R.id.tv_estimate_fee);
            tvTitle.setText("新楼价格(" + ConvertUtils.StringToNumber(i) + ")");
            tvUnitPrice.setText(bean.getUnit_price());
            tvReferenceName.setText(bean.getReference_name());
            tvEstimateFee.setText(bean.getEstimate_fee());
            i++;
            layout.addView(view);
        }
        int j = 1;
        for (CommentaryExamineEntity.EvaluateBean.Evaluate2Bean bean : evaluate2) {
            View view = LayoutInflater.from(_mActivity).inflate(R.layout.item_examine_price_zhong, null);
            TextView tvTitle = (TextView) view.findViewById(R.id.tv_new_title);
            TextView tvUnitPrice = (TextView) view.findViewById(R.id.tv_unit_price);
            TextView tvReferenceName = (TextView) view.findViewById(R.id.tv_reference_name);
            TextView tvEvaluateSource = (TextView) view.findViewById(R.id.tv_evaluate_source);
            TextView tvContacts = (TextView) view.findViewById(R.id.tv_contacts);
            tvTitle.setText("中介2个月快速成交价(" + ConvertUtils.StringToNumber(j) + ")");
            tvUnitPrice.setText(bean.getUnit_price());
            tvReferenceName.setText(bean.getReference_name());
            tvEvaluateSource.setText(bean.getEvaluate_source());
            tvContacts.setText(bean.getContacts());
            j++;
            layout.addView(view);
        }
        mViewHolder.expandableLayoutPriceSurvey.addView(layout);
    }

    class ViewHolder {
        @BindView(R.id.tv_pawn_no)
        TextView tvPawnNo;
        @BindView(R.id.tv_tuft_info_click)
        TextView tvTuftInfoClick;
        @BindView(R.id.tv_property_owner)
        TextView tvPropertyOwner;
        @BindView(R.id.tv_house_located)
        TextView tvHouseLocated;
        @BindView(R.id.tv_community_name)
        TextView tvCommunityName;
        @BindView(R.id.tv_certificate_number)
        TextView tvCertificateNumber;
        @BindView(R.id.tv_structure_area)
        TextView tvStructureArea;
        @BindView(R.id.tv_build_year)
        TextView tvBuildYear;
        @BindView(R.id.tv_door_number)
        TextView tvDoorNumber;
        @BindView(R.id.tv_ring_rd_direction)
        TextView tvRingRdDirection;
        @BindView(R.id.tv_room_construction)
        TextView tvRoomConstruction;
        @BindView(R.id.tv_property_right_type)
        TextView tvPropertyRightType;
        @BindView(R.id.tv_house_use)
        TextView tvHouseUse;
        @BindView(R.id.tv_checkin_date)
        TextView tvCheckinDate;
        @BindView(R.id.tv_hourse_orientation)
        TextView tvHourseOrientation;
        @BindView(R.id.tv_room_amount)
        TextView tvRoomAmount;
        @BindView(R.id.tv_floor_number)
        TextView tvFloorNumber;
        @BindView(R.id.tv_all_floor)
        TextView tvAllFloor;
        @BindView(R.id.tv_fitment_status)
        TextView tvFitmentStatus;
        @BindView(R.id.tv_structure_type)
        TextView tvStructureType;
        @BindView(R.id.tv_usein_statue)
        TextView tvUseinStatue;
        @BindView(R.id.tv_structure_modify)
        TextView tvStructureModify;
        @BindView(R.id.tv_is_only_house)
        TextView tvIsOnlyHouse;
        @BindView(R.id.tv_other_house_amount)
        TextView tvOtherHouseAmount;
        @BindView(R.id.tv_purchase_year)
        TextView tvPurchaseYear;
        @BindView(R.id.expandable_layout_tuft_info)
        ExpandableLayout expandableLayoutTuftInfo;
        @BindView(R.id.tv_tuft_mating_click)
        TextView tvTuftMatingClick;
        @BindView(R.id.tv_support_water)
        TextView tvSupportWater;
        @BindView(R.id.tv_support_gas)
        TextView tvSupportGas;
        @BindView(R.id.tv_support_heat)
        TextView tvSupportHeat;
        @BindView(R.id.tv_support_lift)
        TextView tvSupportLift;
        @BindView(R.id.tv_support_carport)
        TextView tvSupportCarport;
        @BindView(R.id.tv_support_other_carport)
        TextView tvSupportOtherCarport;
        @BindView(R.id.tv_has_service_charge)
        TextView tvHasServiceCharge;
        @BindView(R.id.tv_service_name)
        TextView tvServiceName;
        @BindView(R.id.tv_service_money_standard)
        TextView tvServiceMoneyStandard;
        @BindView(R.id.expandable_layout_tuft_mating)
        ExpandableLayout expandableLayoutTuftMating;
        @BindView(R.id.tv_way_status_info_click)
        TextView tvWayStatusInfoClick;
        @BindView(R.id.tv_road_name)
        TextView tvRoadName;
        @BindView(R.id.tv_road_distance)
        TextView tvRoadDistance;
        @BindView(R.id.tv_road_level)
        TextView tvRoadLevel;
        @BindView(R.id.tv_transit)
        TextView tvTransit;
        @BindView(R.id.tv_transit_distance)
        TextView tvTransitDistance;
        @BindView(R.id.tv_metro)
        TextView tvMetro;
        @BindView(R.id.tv_metro_distance)
        TextView tvMetroDistance;
        @BindView(R.id.expandable_layout_way_status)
        ExpandableLayout expandableLayoutWayStatus;
        @BindView(R.id.tv_rim_mating_info_click)
        TextView tvRimMatingInfoClick;
        @BindView(R.id.tv_support0)
        TextView tvSupport0;
        @BindView(R.id.tv_support1)
        TextView tvSupport1;
        @BindView(R.id.tv_support2)
        TextView tvSupport2;
        @BindView(R.id.expandable_layout_rim_mating)
        ExpandableLayout expandableLayoutRimMating;
        @BindView(R.id.tv_land_info_click)
        TextView tvLandInfoClick;
        @BindView(R.id.tv_land_position)
        TextView tvLandPosition;
        @BindView(R.id.tv_land_use)
        TextView tvLandUse;
        @BindView(R.id.tv_landl_certificate_number)
        TextView tvLandlCertificateNumber;
        @BindView(R.id.tv_land_end_date)
        TextView tvLandEndDate;
        @BindView(R.id.tv_land_use_type)
        TextView tvLandUseType;
        @BindView(R.id.tv_land_area)
        TextView tvLandArea;
        @BindView(R.id.expandable_layout_land_info)
        ExpandableLayout expandableLayoutLandInfo;
        @BindView(R.id.tv_price_survey_info_click)
        TextView tvPriceSurveyInfoClick;
        //        @BindView(R.id.lly_price_survey_container)
//        LinearLayout llyPriceSurveyContainer;
        @BindView(R.id.expandable_layout_price_survey)
        ExpandableLayout expandableLayoutPriceSurvey;
        @BindView(R.id.tv_collateral_remark_info_click)
        TextView tvCollateralRemarkInfoClick;
        @BindView(R.id.tv_collateral_remark)
        TextView tvCollateralRemark;
        @BindView(R.id.expandable_layout_collateral_remark)
        ExpandableLayout expandableLayoutCollateralRemark;
        @BindView(R.id.tv_collateral_opinion_info_click)
        TextView tvCollateralOpinionInfoClick;
        @BindView(R.id.tv_collateral_opinion)
        TextView tvCollateralOpinion;
        @BindView(R.id.expandable_layout_collateral_opinion)
        ExpandableLayout expandableLayoutCollateralOpinion;
        @BindView(R.id.tv_special_note_info_click)
        TextView tvSpecialNoteInfoClick;
        @BindView(R.id.tv_special_note)
        TextView tvSpecialNote;
        @BindView(R.id.expandable_layout_special_note)
        ExpandableLayout expandableLayoutSpecialNote;
        @BindView(R.id.tv_accessory_info_click)
        TextView tvAccessoryInfoClick;

        public ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }


        @OnClick({R.id.tv_tuft_info_click, R.id.tv_tuft_mating_click, R.id.tv_way_status_info_click, R.id.tv_rim_mating_info_click, R.id.tv_land_info_click, R.id.tv_price_survey_info_click, R.id.tv_collateral_remark_info_click, R.id.tv_collateral_opinion_info_click, R.id.tv_special_note_info_click, R.id.tv_accessory_info_click})
        public void onViewClicked(View view) {
            switch (view.getId()) {
                case R.id.tv_tuft_info_click:
                    if (mViewHolder.expandableLayoutTuftInfo.isExpanded()) {
                        mViewHolder.expandableLayoutTuftInfo.collapse();
                        setExpandDrawable(mViewHolder.tvTuftInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutTuftInfo.expand();
                        setExpandDrawable(mViewHolder.tvTuftInfoClick, true);
                    }
                    break;
                case R.id.tv_tuft_mating_click:
                    if (mViewHolder.expandableLayoutTuftMating.isExpanded()) {
                        mViewHolder.expandableLayoutTuftMating.collapse();
                        setExpandDrawable(mViewHolder.tvTuftMatingClick, false);
                    } else {
                        mViewHolder.expandableLayoutTuftMating.expand();
                        setExpandDrawable(mViewHolder.tvTuftMatingClick, true);
                    }
                    break;
                case R.id.tv_way_status_info_click:
                    if (mViewHolder.expandableLayoutWayStatus.isExpanded()) {
                        mViewHolder.expandableLayoutWayStatus.collapse();
                        setExpandDrawable(mViewHolder.tvWayStatusInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutWayStatus.expand();
                        setExpandDrawable(mViewHolder.tvWayStatusInfoClick, true);
                    }
                    break;
                case R.id.tv_rim_mating_info_click:
                    if (mViewHolder.expandableLayoutRimMating.isExpanded()) {
                        mViewHolder.expandableLayoutRimMating.collapse();
                        setExpandDrawable(mViewHolder.tvRimMatingInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutRimMating.expand();
                        setExpandDrawable(mViewHolder.tvRimMatingInfoClick, true);
                    }
                    break;
                case R.id.tv_land_info_click:
                    if (mViewHolder.expandableLayoutLandInfo.isExpanded()) {
                        mViewHolder.expandableLayoutLandInfo.collapse();
                        setExpandDrawable(mViewHolder.tvLandInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutLandInfo.expand();
                        setExpandDrawable(mViewHolder.tvLandInfoClick, true);
                    }
                    break;
                case R.id.tv_price_survey_info_click:
                    if (mViewHolder.expandableLayoutPriceSurvey.isExpanded()) {
                        mViewHolder.expandableLayoutPriceSurvey.collapse();
                        setExpandDrawable(mViewHolder.tvPriceSurveyInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutPriceSurvey.expand();
                        setExpandDrawable(mViewHolder.tvPriceSurveyInfoClick, true);
                    }
                    break;
                case R.id.tv_collateral_remark_info_click:
                    if (mViewHolder.expandableLayoutCollateralRemark.isExpanded()) {
                        mViewHolder.expandableLayoutCollateralRemark.collapse();
                        setExpandDrawable(mViewHolder.tvCollateralRemarkInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutCollateralRemark.expand();
                        setExpandDrawable(mViewHolder.tvCollateralRemarkInfoClick, true);
                    }
                    break;
                case R.id.tv_collateral_opinion_info_click:
                    if (mViewHolder.expandableLayoutCollateralOpinion.isExpanded()) {
                        mViewHolder.expandableLayoutCollateralOpinion.collapse();
                        setExpandDrawable(mViewHolder.tvCollateralOpinionInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutCollateralOpinion.expand();
                        setExpandDrawable(mViewHolder.tvCollateralOpinionInfoClick, true);
                    }
                    break;
                case R.id.tv_special_note_info_click:
                    if (mViewHolder.expandableLayoutSpecialNote.isExpanded()) {
                        mViewHolder.expandableLayoutSpecialNote.collapse();
                        setExpandDrawable(mViewHolder.tvSpecialNoteInfoClick, false);
                    } else {
                        mViewHolder.expandableLayoutSpecialNote.expand();
                        setExpandDrawable(mViewHolder.tvSpecialNoteInfoClick, true);
                    }
                    break;
                case R.id.tv_accessory_info_click:
//                    if (mAdapter.isExpandable()) {
//                        mAdapter.setExpandable(false);
//                        mAdapter.notifyDataSetChanged();
//                        setExpandDrawable(mViewHolder.tvAccessoryInfoClick, false);
//                    } else {
//                        mAdapter.setExpandable(true);
//                        mAdapter.notifyDataSetChanged();
//                        setExpandDrawable(mViewHolder.tvAccessoryInfoClick, true);
//                    }
                    break;
            }
        }
    }
}
